home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
swtools
/
trubasic
/
rolldemos
/
demos
/
3d
/
topo3.tru
< prev
next >
Wrap
Text File
|
1994-08-02
|
1KB
|
60 lines
!
! TOPO3
!
! Demonstrate Tplot used to complement Zplot.
! Designed for computers with lots of colors.
! Silicon Graphics Personal Iris Version.
!
LIBRARY "3dcont.trc"
CALL tw_wset_title(0,"Topo3")
CALL tw_wset_size(0,750,750)
clear
ASK MAX COLOR mc
IF mc > 4 then !hi resolution - Personal Iris
CALL SetColor3("10 [.01] 9 [.1] 12 [.5] 13 [1] 15 [2] yellow")
CALL SetZlines3(80)
ELSE IF mc > 1 then !medium resolution
CALL SetColor3("green [.01] yellow [.1] red [.5] green [1] yellow [2] red")
CALL SetZlines3(40)
SET BACK "blue"
ELSE !monochrome
CALL SetZlines3(80)
END IF
CALL SetZseg3(125)
CALL PersWindow(-pi,pi,-pi,pi,-6,1.2)
CALL SetCamera3(-15,-25,18)
CALL SetScale3(1.5,1.2)
CALL Zplot
IF mc > 4 then
SET COLOR "blue"
CALL Block3(-pi,pi,-pi,pi,-6.5,-6,"blue","blue","cyan",0)
ELSE
CALL Block3(-pi,pi,-pi,pi,-6.5,-6,"1","1","0",0)
END IF
CALL SetMesh3(50,50)
CALL SetTlines3(15)
CALL Tplot(-6)
IF mc > 4 then
SET COLOR "red"
ASK WINDOW x1,x2,y1,y2
!FLOOD x1,y1 ! slow for X windows
END IF
get point x,y
END
!
!
! Our function to plot. A strange one with two lumps.
!
DEF F(x,y)
LET x1 = x-1
LET y1 = y-1
LET a = x1*x1 + y1*y1
LET x1 = x+1
LET y1 = y+1
LET b = x1*x1 + y1*y1
LET F = 1.5*cos(1.75*b)*exp(-.4*b) + 3.5*cos(1.75*a)*exp(-.8*a)
END DEF